package com.lc.demo.mapper;

import com.lc.demo.bean.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;


public interface StudentMapper {

    @Select("select * from student where  username=#{username} and password=#{password}")
    Student selectStudentByUsernameAndPaassword(@Param("username") String stuId, @Param("password") String stuPass);

    @Select("select * from student where  username=#{username} ")
    Student selectByUsername(String username);

    @Insert("insert into student  values(#{username},#{password},#{name},#{sex},#{nation},#{card},#{school},#{education} ,#{major} ,#{classid} ,#{status} ,#{phone})")
    void addStudent(Student student);

    @Delete("delete from student where username=#{username}")
    void delStudentByUsername(String username);

    @Select("select * from student ")
    List<Student> getStudentList();

    @Update("update student set password=#{password}, name=#{name},sex=#{sex},nation=#{nation},card=#{card},school=#{school},education=#{education},major=#{major}," +
            "classid=#{classid},status=#{status},phone=#{phone} where username=#{username}")
    void updateStudent(Student student);







}
